Carbon


NavAskSaveChanges

Header: Navigation.h Carbon status: Supported

Displays a Save Changes alert box.

OSErr NavAskSaveChanges (
    NavDialogOptions *dialogOptions, 
    NavAskSaveChangesAction action, 
    NavAskSaveChangesResult *reply, 
    NavEventUPP eventProc, 
    void *callBackUD
);
dialogOptions

A pointer to a structure of type NavDialogOptions. Before calling NavAskSaveChanges, set up this structure to specify dialog box settings. When calling NavAskSaveChanges, the clientName and savedFileName fields are the only two fields you must supply with values.

action

A value of type NavAskSaveChangesAction. Pass a constant describing the user action that prompted the Save Changes alert box. For a description of the constants, see “Save Changes Request Constants”.

reply

A pointer to a structure of type NavAskSaveChangesResult. On return, the value describes the user’s response to the Save Changes alert box. For a description of the constants used to represent possible responses, see “Save Changes Action Constants”.

eventProc

A Universal Procedure Pointer (UPP) of type NavEventProcPtr that points to your application-defined event-handling function. You obtain this UPP by calling the macro NewNavEventProc. Implementing an event-handling function allows your application to update windows after the user moves or resizes the dialog box. If you pass NULL in this parameter, the Save Changes alert box is not movable. For more information, see “Handling Events”.

callBackUD

A pointer to a value set by your application. When the NavAskSaveChanges function calls your event-handling function, the callBackUD value is passed back to your application.

function result

A result code.

DISCUSSION

This function is useful when your application needs to display an alert when the user attempts to close a document or an application with unsaved changes.

VERSION NOTES

Available in Navigation Services 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when NavigationLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by NavigationLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/17/2000)